package com.vallis.lottery.domain;

import com.vallis.common.core.domain.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.vallis.common.annotation.Excel;
import com.baomidou.mybatisplus.annotation.TableField;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

/**
 * 邀请码对象 sn_number
 *
 * @author vallis
 * @date 2022-08-10
 */
@Builder
@Data
@NoArgsConstructor
@AllArgsConstructor
public class SnNumber extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /** id */
    @TableId(type = IdType.AUTO)
    private Long id;
    /** 邀请码 */
    @Excel(name = "邀请码")
    private String snNumber;
    /** 邀请码类型 */
    @Excel(name = "邀请码类型")
    private Long snType;
    /** 使用此码的用户 */
    @Excel(name = "使用此码的用户")
    private Long useBy;
    /** 所属的用户 */
    @Excel(name = "所属的用户")
    private Long useFrom;
    /** 使用时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "使用时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date useTime;
    /** 到期时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "到期时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date offTime;

    private int isUse;

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("snNumber", getSnNumber())
            .append("snType", getSnType())
            .append("createTime", getCreateTime())
            .append("createBy", getCreateBy())
            .append("updateBy", getUpdateBy())
            .append("updateTime", getUpdateTime())
            .append("deleted", getDeleted())
            .append("remark", getRemark())
            .append("useBy", getUseBy())
            .append("useFrom", getUseFrom())
            .append("useTime", getUseTime())
            .append("offTime", getOffTime())
                .append("isUse",getIsUse())
        .toString();
    }
}
